package com.taiji.dicom4cloud.smart.rfid.config;

import com.taiji.dicom4cloud.smart.rfid.handler.*;
import com.taiji.dicom4cloud.smart.rfid.manager.MessageStrategyManager;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description
 * @Author fanxl
 * @Date 2021/7/21
 **/
@Configuration
public class RfidConfig {


    @Bean
    @ConditionalOnMissingBean
    public StopHandler stopHandler(){
        return new StopHandler();
    }


    @Bean
    @ConditionalOnMissingBean
    public SetPowerHandler setPowerHandler(){
        return new SetPowerHandler();
    }

    @Bean
    @ConditionalOnMissingBean
    public GetPowerHandler getPowerHandler(){
        return new GetPowerHandler();
    }


    @Bean
    @ConditionalOnMissingBean
    public InventoryHandler inventoryHandler(){
        return new InventoryHandler();
    }

    @Bean
    @ConditionalOnMissingBean
    public InventoryDataHandler inventoryDataHandler(){
        return new InventoryDataHandler();
    }

    @Bean
    public ConnectHandler connectHandler(){
        return new ConnectHandler();
    }
    @Bean
    public DisConnectHandler disConnectHandler(){
        return new DisConnectHandler();
    }
    @Bean
    public InvStopHandler invStopHandler(){
        return new InvStopHandler();
    }


    @Bean(value = "iRfidMessageStrategyManagerService")
    @ConditionalOnMissingBean
    public MessageStrategyManager rfidMessageStrategyManager(){
        return new MessageStrategyManager();
    }


}
